package com.xdb.sqlparser.dialect.oracle.ast;

import java.util.ArrayList;
import java.util.List;

import com.xdb.sqlparser.ast.SQLDataTypeImpl;
import com.xdb.sqlparser.ast.SQLExpr;
import com.xdb.sqlparser.dialect.oracle.visitor.OracleASTVisitor;
import com.xdb.sqlparser.visitor.SQLAstVisitor;

public class OracleDataTypeIntervalDay extends SQLDataTypeImpl implements OracleSQLObject {

	private boolean toSecond = false;

	protected final List<SQLExpr> fractionalSeconds = new ArrayList<SQLExpr>();

	public OracleDataTypeIntervalDay() {
		this.setName("INTERVAL DAY");
	}

	@Override
	protected void accept0(SQLAstVisitor visitor) {
		this.accept0((OracleASTVisitor) visitor);
	}

	@Override
	public void accept0(OracleASTVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, getArguments());
		}
		visitor.endVisit(this);
	}

	public boolean isToSecond() {
		return toSecond;
	}

	public void setToSecond(boolean toSecond) {
		this.toSecond = toSecond;
	}

	public List<SQLExpr> getFractionalSeconds() {
		return fractionalSeconds;
	}

}
